<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="bean.Donate"%>

<html>
	<body>
		<%
			String randStr = (String) session.getAttribute("randStr");
			String checkcode = request.getParameter("checkcode");
			Donate donate = new Donate();
			donate.setDonate_name(request.getParameter("onlineName"));
			donate.setDonate_price(request.getParameter("onlinePrice"));
			donate.setDonate_need(request.getParameter("onlineProject"));
			donate.setDonate_email(request.getParameter("onlineEmail"));
			donate.setDonate_telephone(request.getParameter("onlineTelephone"));
			donate.setDonate_address(request.getParameter("onlineAddress"));
			donate.setDonate_postalcode(request.getParameter("onlinePostalcode"));
			donate.setDonate_alumni(request.getParameter("onlineAlumni"));
			String classInformation = null;
			if(donate.getDonate_alumni()!=null && donate.getDonate_alumni().equals("yes")) {
				classInformation = request.getParameter("onlineClassInformation");
			}
			donate.setDonate_classInformation(classInformation);
			donate.setRemark(request.getParameter("onlineContent"));
			
			session.setAttribute("onlineDonate",donate);
			
			if (!randStr.equals(checkcode)) {
		%>
			<script type="text/javascript">
				alert("验证码不正确!")
				location.href = "../online.jsp";
			</script>
		<%
			}else {
				response.sendRedirect("../writeOnlineDonate");		
			}
		%>
	</body>
</html>